home *** CD-ROM | disk | FTP | other *** search
- ===========================================================================
- BBS: The Abacus * HST/DS * Potterville MI
- Date: 05-14-93 (08:49) Number: 72
- From: BOB STOUT Refer#: 219
- To: MARTIN CONNELLY Recvd: NO
- Subj: Re: DRIVSRCH.C (was PART Conf: (36) C Language
- ---------------------------------------------------------------------------
- In a message of <May 07 23:10>, Martin Connelly (1:340/303@fidonet) writes:
-
- > I've missed all the previous posts. Out of the country. So, what
- > changed?
-
- /*
- * Name: DRIVSRCH.C
- *
- * Purpose: Replacement for Snippets DRIVSRCH.C that includes
- * detection of network drives for Novell NetWare, SUBST
- * drives, and works with Microsoft C.
- *
- * Notes: Should work with any DOS compiler, but I don't have Borland or
- * Zortech to test it with. The Interrupt List shows this as
- * being valid for DOS 3.1+. May or may not produce 'correct'
- * results with other network operating systems.
- *
- * Credits: Ralf Brown for the infamous Interrupt List.
- *
- * Written by: David Gersic 26 April, 1993
- * Released to the public domain.
- *
- * Tested with: Microsoft C 6.00a, Compaq DOS 3.31, Novell NetWare 3.11
- *
- */
-
- #include <stdio.h>
- #include <dos.h>
- #include <stdlib.h>
-
- main()
- {
- union REGS in, out;
- int i;
- char drives[]={' ','a','b','c','d','e','f','g', /* Netware uses up */
- 'h','i','j','k','l','m','n','o', /* to 32 drive */
- 'p','q','r','s','t','u','v','w', /* 'letters' */
- 'x','y','z','[','\\',']','^','`'};
-
- in.x.ax=0x4409; /* IOCTL function - CHECK IF BLOCK DEVICE REMOTE */
- for(i=1;i<32;i++)
- {
- in.h.bl=(unsigned char)i; /* 1==a:, 2==b:, etc. */
- intdos(&in,&out);
- if(!out.x.cflag) /* carry flag set on error */
- /* bit 15 == subst, bit 12 == 'remote' */
- printf("drive %c: is %s\n",
- drives[i],out.x.dx & 1<<15 ? "subst" :
- out.x.dx & 1<<12 ? "network" : "local");
- }
- return(0);
- }
-
-
- --- QM v1.00
- * Origin: MicroFirm : Down to the C in chips (1:106/2000.6)
- SEEN-BY: 1/211 11/2 4 13/13 101/1 108/89 109/25 110/69 114/5 123/19 124/1
- SEEN-BY: 153/752 154/40 77 157/2 159/100 125 575 950 203/23 209/209 261/1023
- SEEN-BY: 280/1 390/1 396/1 5 15 2270/1 2440/5 3603/20
-